package llama.ctrl;

import llama.core.ChatModelLocator;
import llama.core.IUser;
import llama.util.SystemMessage;

public class ConversationCtrl implements IController {
	public enum ConversationOption {
		SELECT,
		CLOSE
	}
	
	private IUser contact;
	private ConversationOption conversationOption;
	
	@Override
	public void execute() {
		switch (conversationOption) {
		case SELECT:
			ChatModelLocator.getChatModel().send(new SystemMessage(contact, SystemMessage.Type.SELECT_CONVERSATION));
			break;
		case CLOSE:
			ChatModelLocator.getChatModel().send(new SystemMessage(contact, SystemMessage.Type.CLOSE_CONVERSATION));
			break;
		}
	}

	public void setSelectedContact(ConversationOption conversationOption, final IUser iUser) {
		this.contact = iUser;
		this.conversationOption = conversationOption;
	}
}
